// import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref, onMounted } from 'vue';
import { getItemApi } from '@/api/demo/code';
import { useI18n } from "@/hooks/web/useI18n";

const { t } = useI18n();
/**
 * transform mock data
 * {
 *  0: '华东分部',
 * '0-0': '华东分部-研发部'
 * '0-1': '华东分部-市场部',
 *  ...
 * }
 */
// export const deptMap = (() => {
//   const pDept = ['华东分部', '华南分部', '西北分部'];
//   const cDept = ['研发部', '市场部', '商务部', '财务部'];

//   return pDept.reduce((map, p, pIdx) => {
//     map[pIdx] = p;

//     cDept.forEach((c, cIndex) => (map[`${pIdx}-${cIndex}`] = `${p}-${c}`));

//     return map;
//   }, {});
// })();
//表头数据
export const columns: BasicColumn[] = [
  {
    title: t('sys.informaionMatchaing.columns.title'),
    dataIndex: 'title',
    width: 50,
  },
  {
    title: t('sys.configuration.describe'),
    dataIndex: 'content',
    width: 50,
  },
  {
    title:  t('sys.informaionMatchaing.columns.district'),
    dataIndex: 'district',
    width: 50,
  },

  // {
  //   title:  t('sys.informaionMatchaing.columns.age'),
  //   dataIndex: 'age',
  //   width: 50,
  // },
  // {
  //   title:  t('sys.informaionMatchaing.columns.gender'),
  //   dataIndex: 'gender',
  //   width: 50,
  // },
  {
    title:  t('sys.informaionMatchaing.columns.audience'),
    dataIndex: 'audience',
    width: 50,
  },
  {
    title:  t('sys.informaionMatchaing.columns.interest'),
    dataIndex: 'interest',
    width: 50,
  },
  {
    title: t('sys.device.columns.remck'),
    dataIndex: 'remark',
    width: 50,
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'title',
    component: 'Input',
    label: t('sys.informaionMatchaing.columns.title'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    rules: [{ required: true }],
  },
  {
    field: 'content',
    component: 'InputTextArea',
    label: t('sys.configuration.describe'),
    defaultValue: '',
    colProps: {
      span: 24,
    },
    componentProps: {
      rows: 3, // 设置文本域的行数
    },
    rules: [{ required: true }],
  },
  {
    field: 'district',
    component: 'Input',
    label:  t('sys.informaionMatchaing.columns.district'),
    defaultValue: '',
    rules: [{ required: true }],
  },

  {
    field: 'age',
    component: 'Input',
    label:  t('sys.informaionMatchaing.columns.age'),
    defaultValue: '',
    rules: [{ required: true }],
  },
  {
    field: 'gender',
    component: 'Input',
    label:  t('sys.informaionMatchaing.columns.gender'),
    defaultValue: '',
    rules: [{ required: true }],
  },
  {
    field: 'audience',
    component: 'Input',
    label:  t('sys.informaionMatchaing.columns.audience'),
    defaultValue: '',
    rules: [{ required: true }],
  },
  {
    field: 'interest',
    component: 'InputTextArea',
    label:  t('sys.informaionMatchaing.columns.interest'),
    defaultValue: '',
    componentProps: {
      rows: 3, // 设置文本域的行数
    },
    rules: [{ required: true }],
  },
  {
    field: 'remark',
    component: 'Input',
    label: t('sys.device.columns.remck'),
    defaultValue: '',
    rules: [{ required: true }],
  },
  // {
  //   field: 'type',
  //   component: 'Select',
  //   label: t('sys.device.columns.devicecode'),
  //   defaultValue: '',
  //   rules: [{ required: true }],
  //   componentProps: {
  //     options: [],
  //   },
  // },
];

//基础字段
export const accountFormSchemaFields: FormSchema[] = [
  {
    field: 'title',
    component: 'Input',
    label: t('sys.video.columns.submitTitel'),
    defaultValue: '',

    rules: [{ required: true }],
  },
  {
    field: 'title',
    component: 'RadioGroup',
    label: t('sys.video.columns.isPhoto'),
    defaultValue: '',
    componentProps: {
      options: [
        {
          label: t('sys.configuration.YES'),
          value: '1',
        },
        {
          label: t('sys.configuration.NO'),
          value: '2',
        },
      ],
    },

    rules: [{ required: true }],
  },
  {
    field: 'title',
    component: 'RadioGroup',
    label: t('sys.video.columns.submitType'),
    defaultValue: '',
    rules: [{ required: true }],
    componentProps: {
      options: [
        {
          label: t('sys.video.columns.trueType'),
          value: '1',
        },
        {
          label: t('sys.video.columns.selectType'),
          value: '2',
        },
        {
          label: t('sys.video.columns.selectListType'),
          value: '3',
        },
      ],
    },
  },
  {
    field: 'title',
    component: 'Input',
    label: t('sys.video.columns.configurationOptions'),
    defaultValue: '',

    rules: [{ required: true }],
  },
];
